from django.db import models

# Create your models here.
class Cate(models.Model):
    name = models.CharField(max_length=12,verbose_name='种类')
    class Meta:
        verbose_name = '种类信息表'
        verbose_name_plural=verbose_name
        db_table='cate'
    def __str__(self):
        return self.name




class Film(models.Model):
    name = models.CharField('电影名称',max_length=20)
    dir = models.CharField('导演',max_length=20)
    star = models.CharField('主演',max_length=20)
    item = models.DateTimeField('时间',max_length=30)
    img = models.CharField('图片',max_length=200)
    score = models.CharField('评分',max_length=30)
    kind = models.ForeignKey(Cate,on_delete=models.CASCADE,verbose_name='所属类别')
    class Meta:
        db_table = 'film'
        verbose_name = '电影表'
        verbose_name_plural = verbose_name
    def __str__(self):
        return self.name